<!DOCTYPE html ng-app="myApp">
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../js/angular.js"></script>
	</head>
	<body>
	<div>
    <h5>Custom Capitalize Filter:</h5>
    <input {{ 'ginger loves dog bones' | lowercase | capitalize }}/>
  </div>

  <div>
    <h5>Custom blankIfNegative Filter:</h5>
    <input ng-model="name"  />
    <p>{{name}}</p>
    <input {{ -15 | blankIfNegative }}/>
  </div>

  <script>
    angular.module('myApp', ['myApp.filters']);

    angular.module('myApp.filters', [])
    .filter('capitalize', function() {
      return function(input) {
        // input will be the string we pass in
        if (input) {
          return input[0].toUpperCase() + input.slice(1);
        }
      }
    })
    .filter('blankIfNegative', function() {
      return function(input) {
        if (input <= 0) return ' ';
        else return input;
      }
    });
  </script>

</body>
</html>